#include <iostream>
#include<cstring>
using namespace std;
//
class Computer{
public:
    void gets(){
        cout<<_branch<<"price:"<<_price<<endl;
    }
    Computer(const Computer &)=delete;
    Computer &operator=(const Computer&)=delete;
    static Computer& getinstall() {
       static Computer com("Xiaomi",1234);//
        return com;
    }
private:
    Computer(const char *branch,int price)
    :_branch(new char [strlen(branch)+1]())
    ,_price(price)
    {   
        strcpy(_branch,branch);
        cout<<"Computer"<<endl;
    }
    ~Computer(){
        if(_branch){
            delete _branch;
            _branch = nullptr;
        }
        cout<<"~Computer"<<endl;
    }
    char * _branch;
    int _price;
    //static Computer comp; 

};
int main()
{
    Computer::getinstall().gets(); 
    cout<<&(Computer::getinstall())<<endl;
    cout<<&(Computer::getinstall())<<endl;
    return 0;
}

